﻿using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Common
{
    public class AllExceptionFilters : IExceptionFilter
    {
        private readonly ILogger<AllExceptionFilters> logger;

        public AllExceptionFilters(ILogger<AllExceptionFilters> logger)
        {
            this.logger = logger;
        }

        public void OnException(ExceptionContext context)
        {
            logger.LogInformation($"【全局异常】：{context.Exception.Message}");
        }
    }
}
